﻿using J.Status.Application.Command.RoomTypeCommand;
using J.StatusModel;
using MediatR;
using StatusService;

namespace J.Status.Application.Handler.RoomTypeHandler
{
    public class ReturnRoomNumHandler : IRequestHandler<ReturnRoomNumCommand, List<RoomNumManage>>
    {
        private readonly IRoomTypeService roomTypeService;

        public ReturnRoomNumHandler(IRoomTypeService roomTypeService)
        {
            this.roomTypeService = roomTypeService;
        }

        public async Task<List<RoomNumManage>> Handle(ReturnRoomNumCommand request, CancellationToken cancellationToken)
        {
            return await roomTypeService.ReturnRoomNum(request.roomTypeId);
        }
    }
}
